<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		 <script src="jQuery-2.1.4.min.js"></script>
		 <script src="infovis.min.js"></script>
	</head>
	<body>
		  <div id="test" style="width: 500px; height: 300px; border: 1px solid red;"></div>
 		<div>
 			<button onclick="cleartest()">清除</button>
 			<button onclick="create()">创建</button>
 			<button onclick="getInstance()">console</button>
 		</div>
	</body>
	<script>
			var engine;
		 
        function cleartest(){
        	console.log(11)
        	 $("#test").empty();
        }
        function create(){
        	 $.getJSON('test2.json', function(config) {
             engine = infovis.init(config || {});
            if(engine) {          
                engine.render("test", "dataset02", "chart1") 
            }
        });
        	
        }
        
        function getInstance(){
            engine=infovis.reload(true).init(config || {});
            var instance=engine.chartInstances["test"];
            console.log(instance);
            instance.resize();
        }
	</script>
</html>
